
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/holonomic/convert.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:21 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Converting other representations to holonomic &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../live.sympy.org/static/live-sphinx.js"></script>
    
    <link rel="shortcut icon" href="../../_static/sympy-notailtext-favicon.ico"/>
    <link href="convert.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Uses and Current limitations" href="uses.html" />
    <link rel="prev" title="Operations on holonomic functions" href="operations.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="uses.html" title="Uses and Current limitations"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="operations.html" title="Operations on holonomic functions"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Holonomic</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Converting other representations to holonomic</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="converting-other-representations-to-holonomic">
<h1>Converting other representations to holonomic<a class="headerlink" href="#converting-other-representations-to-holonomic" title="Permalink to this headline">¶</a></h1>
<section id="converting-hypergeometric-functions">
<h2>Converting hypergeometric functions<a class="headerlink" href="#converting-hypergeometric-functions" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.holonomic.holonomic.from_hyper">
<span class="sig-prename descclassname"><span class="pre">sympy.holonomic.holonomic.</span></span><span class="sig-name descname"><span class="pre">from_hyper</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evalf</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/holonomic/holonomic.py#L2155-L2226"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.holonomic.holonomic.from_hyper" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a hypergeometric function to holonomic.
<code class="docutils literal notranslate"><span class="pre">func</span></code> is the Hypergeometric Function and <code class="docutils literal notranslate"><span class="pre">x0</span></code> is the point at
which initial conditions are required.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.holonomic.holonomic</span> <span class="kn">import</span> <span class="n">from_hyper</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">hyper</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">from_hyper</span><span class="p">(</span><span class="n">hyper</span><span class="p">([],</span> <span class="p">[</span><span class="n">S</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">],</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">4</span><span class="p">))</span>
<span class="go">HolonomicFunction((-x) + (2)*Dx + (x)*Dx**2, x, 1, [sinh(1), -sinh(1) + cosh(1)])</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="converting-meijer-g-functions">
<h2>Converting Meijer G-functions<a class="headerlink" href="#converting-meijer-g-functions" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.holonomic.holonomic.from_meijerg">
<span class="sig-prename descclassname"><span class="pre">sympy.holonomic.holonomic.</span></span><span class="sig-name descname"><span class="pre">from_meijerg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evalf</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initcond</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">QQ</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/holonomic/holonomic.py#L2229-L2308"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.holonomic.holonomic.from_meijerg" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a Meijer G-function to Holonomic.
<code class="docutils literal notranslate"><span class="pre">func</span></code> is the G-Function and <code class="docutils literal notranslate"><span class="pre">x0</span></code> is the point at
which initial conditions are required.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.holonomic.holonomic</span> <span class="kn">import</span> <span class="n">from_meijerg</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">meijerg</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">from_meijerg</span><span class="p">(</span><span class="n">meijerg</span><span class="p">(([],</span> <span class="p">[]),</span> <span class="p">([</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">]),</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">4</span><span class="p">))</span>
<span class="go">HolonomicFunction((1) + (1)*Dx**2, x, 0, [0, 1/sqrt(pi)])</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="converting-symbolic-expressions">
<h2>Converting symbolic expressions<a class="headerlink" href="#converting-symbolic-expressions" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.holonomic.holonomic.expr_to_holonomic">
<span class="sig-prename descclassname"><span class="pre">sympy.holonomic.holonomic.</span></span><span class="sig-name descname"><span class="pre">expr_to_holonomic</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lenics</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initcond</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/holonomic/holonomic.py#L2317-L2477"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.holonomic.holonomic.expr_to_holonomic" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a function or an expression to a holonomic function.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>func:</strong></p>
<blockquote>
<div><p>The expression to be converted.</p>
</div></blockquote>
<p><strong>x:</strong></p>
<blockquote>
<div><p>variable for the function.</p>
</div></blockquote>
<p><strong>x0:</strong></p>
<blockquote>
<div><p>point at which initial condition must be computed.</p>
</div></blockquote>
<p><strong>y0:</strong></p>
<blockquote>
<div><p>One can optionally provide initial condition if the method
isn’t able to do it automatically.</p>
</div></blockquote>
<p><strong>lenics:</strong></p>
<blockquote>
<div><p>Number of terms in the initial condition. By default it is
equal to the order of the annihilator.</p>
</div></blockquote>
<p><strong>domain:</strong></p>
<blockquote>
<div><p>Ground domain for the polynomials in <code class="docutils literal notranslate"><span class="pre">x</span></code> appearing as coefficients
in the annihilator.</p>
</div></blockquote>
<p><strong>initcond:</strong></p>
<blockquote>
<div><p>Set it false if you don’t want the initial conditions to be computed.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.holonomic.holonomic</span> <span class="kn">import</span> <span class="n">expr_to_holonomic</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sin</span><span class="p">,</span> <span class="n">exp</span><span class="p">,</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr_to_holonomic</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">HolonomicFunction((1) + (1)*Dx**2, x, 0, [0, 1])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr_to_holonomic</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">HolonomicFunction((-1) + (1)*Dx, x, 0, [1])</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../integrals/g-functions.html#sympy.integrals.meijerint._rewrite1" title="sympy.integrals.meijerint._rewrite1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.meijerint._rewrite1</span></code></a>, <a class="reference internal" href="internal.html#sympy.holonomic.holonomic._convert_poly_rat_alg" title="sympy.holonomic.holonomic._convert_poly_rat_alg"><code class="xref py py-obj docutils literal notranslate"><span class="pre">_convert_poly_rat_alg</span></code></a>, <a class="reference internal" href="internal.html#sympy.holonomic.holonomic._create_table" title="sympy.holonomic.holonomic._create_table"><code class="xref py py-obj docutils literal notranslate"><span class="pre">_create_table</span></code></a></p>
</div>
</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Converting other representations to holonomic</a><ul>
<li><a class="reference internal" href="#converting-hypergeometric-functions">Converting hypergeometric functions</a></li>
<li><a class="reference internal" href="#converting-meijer-g-functions">Converting Meijer G-functions</a></li>
<li><a class="reference internal" href="#converting-symbolic-expressions">Converting symbolic expressions</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="operations.html"
                        title="previous chapter">Operations on holonomic functions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="uses.html"
                        title="next chapter">Uses and Current limitations</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/modules/holonomic/convert.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="uses.html" title="Uses and Current limitations"
             >next</a> |</li>
        <li class="right" >
          <a href="operations.html" title="Operations on holonomic functions"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Holonomic</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Converting other representations to holonomic</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/holonomic/convert.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:21 GMT -->
</html>